2.02 ID选择器
1、id属性是标准属性,任何元素都可以有id属性
2、使用id选择器时,要在id值前加“#”,如果不加“#”,会被系统确认为标签,但是没有这个标签。
3、id选择器只能选中一个元素,同一个页面要保证id的唯一性。不同元素有相同的id,也属于非法
4、定义id时,必须以字母开头,可以包含数字,下划线或符号
5、定义id时,不可以与系列标签同名
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>css注释</title>
<style>
#one1{
color:red;
font-size:14px;
}
#one2{
color:green;
font-size:18px;
font-weight:600;
}
</style>
</head>
<body>
<ul>
<li id="one1">我要好好学习</li>
<li id="one2">我要好好学习</li>
</ul>
</body>
</html>
返回值: